<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" placeholder="请输入添加图片的数量" id="i1">
<input type="button" value="大儿" onclick="f(1)">
<input type="button" value="二儿" onclick="f(2)">
<hr>

<script>
    function f(x) {
        let imgName = x==1?"1.jpg":"2.jpg"
        let i1 = document.querySelector("#i1")

        for (let i=0;i<i1.value;i++){
            let img = document.createElement("img")
            img.src = imgName
            img.width = 100;
            document.body.append(img)
        }
    }
</script>
</body>
</html>